package com.lx.spring.config.bean;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.beans.factory.annotation.Value;

public class Person {

    @Value("乔杉")
    private String name;
    @Value("#{30-2}")
    private Integer age;

    @Value("${person.nickname}")
    private String nickName;

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("name", name)
                .append("age", age)
                .append("nickName", nickName)
                .toString();
    }

    public Person() {
    }

    public Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void show(){
        System.out.println("i am " + name);
    }
}
